package qgs.zisu.javaconcurrency.javaconcurrency.chapter4_DaemonThread;

import java.util.Date;
import java.util.Optional;

/**
 * @Author: 蔡翔
 * @Date: 2019/9/22 14:35
 * @Version 1.0
 * 线程 name 、id、优先级
 */
public class ThreadSimpleAPI {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            Optional.of("Hello").ifPresent(System.out::println);
            try {
                Thread.sleep(1_000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"t1");

        Optional.of(t.getName()).ifPresent(System.out::println);
        Optional.of(t.getId()).ifPresent(System.out::println);
        Optional.of(t.getPriority()).ifPresent(System.out::println);
        System.out.println(new Date());
    }
}
